package com.sola.rabbitmq.receive.service;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**   
 * 
 * @Package: com.sola.rabbitmq.receive.service 
 * @author: kangxiaohui   
 * @date: 2017年8月20日 上午10:40:08 
 * @RabbitListener(queues = "queue")
 * 可以同名,但对象必须和发送方的是同一个对象
 */
@Component
public class ReceiveService {

	@RabbitListener(queues = "queue")
	public void process(String data){
		System.out.println("Receive: " + data);
	}
	
	@RabbitListener(queues = "queue")
	public void process(com.sola.rabbitmq.send.entity.User user){
		System.out.println("Receive: " + user);
	}
}
